<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	
	<link rel="stylesheet" href="../css/zTreeStyle.css" type="text/css">
	<script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="../js/jquery.ztree.core-3.5.js"></script>
	<script type="text/javascript" src="../js/jquery.ztree.excheck-3.5.js"></script>
	
	<style type="text/css">
	*{
		margin:0px;
		padding:0px;
	}
	.top{
		width:100%; 
		height:35px; 
		line-height:35px; 
		font-size:12px;	
	}
	.top ul li{
		list-style:none;
		float:right;
		width:60px;
	}
	a{
		color:#06F;
		text-decoration:none;
	}
	a:hover{
		text-decoration:underline;
	}
	.show{
		display:block;
	}
	.hidden{
		display:none;
	}
	.show ul li{
		height:26px;
		line-height:26px;
		background:#FFF;
		padding-left:40px;
		font-size:13px;
		list-style: none;
	}
	.show ul li:hover{
		background:#EFEFEF;
	}
	.show ul li a{
		text-decoration: none;
	}
	.manager_nav{
		height:38px;
		color:#FFF;
		font-size:13px;
		font-weight:bold;
		line-height:36px;
		padding-left:12px;
		border-bottom:1px dashed #333;
	}
	table tr{
		height: 38px;
	}
	.msg{
		width:280px; 
		height:26px; 
		margin:-26px 250px; 
		position:absolute;
		color:red;
		font-size:2px;
	}
	.resultMsg{
		width:280px; 
		height:80px;
		font-size:30px;
		color:#093;
		font-weight:bold;
		background:#DFDFDF;
		line-height:80px;
		text-align:center;
		border-radius:10px;
		position:absolute;
		z-index:20;
	}
	.ui-mask{ 
		width: 100%;
		height: 100%;
		background: #000;
		position: absolute;
		top: 0px;
		height: 0px;
		z-index: 8;
		opacity:0.4; 
		filter: Alpha(opacity=40);
		display: none;
	}
	</style>
	<script type="text/javascript">
		var setting = {
			check: {
				enable: true
			},
			data: {
				simpleData: {
					enable: true
				}
			}
		};

		var zNodes = ${saTree }

		$(document).ready(function(){
			//初始化必须要用的方法
			$.fn.zTree.init($("#treeDemo"), setting, zNodes);
		});	

		//测试获取选中的
		function checkeds(){
			var tree = $.fn.zTree.getZTreeObj("treeDemo");
			var obj = tree.getCheckedNodes(true);
			var sysauth = document.getElementById("sysauth");
			var sysauthid = 1;

			var mask = g("mask");
			var auth = g("auth");
			
			mask.style.display = "none";
			auth.style.display = "none";
			
			for(var i=1; i<obj.length; i++){
				sysauthid += "::" + obj[i].id;
			}
					
			sysauth.value = sysauthid;
		}	
	</script>
</head>

<body>
	<div style="height:35px;;width:100%;border-bottom:1px solid #CCC; z-index:-1; position:absolute; background:#EFEFEF;"></div>
	<div class="ui-mask" id="mask"></div>	
	<div style="width:1200px; margin:auto;">
		<!-- 顶部索引 -->
        <div class="top">
        	<div style="width:50%; float:left;">你好！欢迎进入中国报险网。</div>
            <div style="width:50%; float:right; text-align:right;">
				<jsp:include page="top2.jsp"></jsp:include>
            </div>
        </div>
        <!-- 修改权限弹层 -->
        <div id="auth" style="display:none; width:1000px; height:auto; background:#FFF; border:1px solid #CCC; margin-top:30px; position: absolute; z-index: 10; margin:30px 100px;">
        	<div style="width:500px; float:left">
          		<ul id="treeDemo" class="ztree"></ul>      	
        	</div>
        	<div style="float: left; color: red; font-size:12px; width:500px; height:auto; margin-top:10px;">温馨提示：
        		<p>因为所有添加页面都有返回按钮，返回到该模块的列表页面，所以请赋予角色添加页面功能时，请考虑赋予该模块列表权限，否则无法点击返回按钮。</p>
        		<p>因为详情权限、修改页面、删除功能在该模块的列表页面里，所以添加这些权限时请选择赋予该模块列表权限。</p>
        	</div>
        	<div style="width:100%; height:50px; line-height:50px; text-align: center; float:left">
        		<input type="button" value="修改" style="width:80px; height:28px; background:#0C9; border:none; color:#FFF;" onclick="checkeds()"/>
				<input type="button" value="取消" style="width:80px; height:28px; background:#0C9; border:none; color:#FFF;" onclick="authClose()"/>	
        	</div>	       
        </div>
        <!-- 后台提示信息 -->
		<input type="hidden" value="${requestScope.upMsg}" id="tips"/>       
        <!-- 主体内容 -->
        <div style="width:100%; height:560px;  font-family: '微软雅黑' ">
            <div style="width: 1100px; height:530px; border:1px solid #406BDD; border-radius:10px; margin:38px 60px;">   
            	<!-- 左边菜单栏 -->
            	<div style="width:20%; height:100%; background:#406BDD; float:left; border-top-left-radius:10px; border-bottom-left-radius:10px;">         		       
            		<jsp:include page="left.jsp"></jsp:include>
            	</div>
            	<div style="width:80%; float:left; background:#EFEFEF; height:100%; border-top-right-radius:10px; border-bottom-right-radius:10px;">    
					<div style="width:95%; height:50px; background:#FFF; margin:6px auto; border:1px solid #888;"></div>
					<div style="margin:10px auto; background:#FFF; width:95%; border:1px solid #888;">						
				    	<form action="${pageContext.request.contextPath }/sysrole/SysRole_uprole.action" method="post">
					    	<table border="0px">
						        <tr height="50px">
						            <td width="100px">&nbsp;角色编号：</td>
						            <td width="380px">
						                ${sysrole.srsid }
						                <input type="hidden" name="srsid" value="${sysrole.srsid }"/>
						            </td>
						        </tr>				   
						        <tr height="50px">
						            <td>&nbsp;角色名称：</td>
						            <td>
						                <input type="text" style="width: 220px; height: 32px; padding-left: 5px;" name="srname" value="${sysrole.srname }"/>
						            </td>
						        </tr>			     
						        <tr height="50px">
						            <td>&nbsp;角色描述：</td>
						            <td>
						            	<textarea rows="5" cols="68" name="srdesc" style="padding:5px 5px;">${sysrole.srdesc }</textarea>
						            </td>
						        </tr>
						       	<tr height="50px">
						            <td>&nbsp;角色权限：</td>
						            <td>
							           	<input type="hidden" id="sysauth" name="sysauth"/>
										<input type="button" value="修改权限" onclick="addAuth()" style="width:80px; height:26px; background:#0C9; border:none; color:#FFF;"/>	
						            </td>
						        </tr>	
						        <tr height="10px;">
						        	<td></td>
						        </tr>
						        <tr height="52px" align="center">
						            <td colspan="2">
						            	<input type="submit" style="width: 120px; height: 32px; background:#406BDD; border: none; color: #FFF; font-size: 16px;" value="确认"/>
						           		<a href="${pageContext.request.contextPath }/sysrole/SysRole_sysrolelist.action">
											<input type="button" style="width: 120px; height: 32px; background:#406BDD; border: none; color: #FFF; font-size: 16px;" value="返回"/>
										</a>						            				            	
						            </td>
						        </tr>
						    </table>
						</form>
					</div>
				</div> 
            </div>
        </div>
        <!-- 版权 -->
        <div style="width:100%; height:30px; text-align:center; line-height:30px; float:left; font-size:14px;">Copyright© 中国报险网 2007-2015，All Rights Reserved</div>
    </div>
    <script type="text/javascript" src="./js/util.js"></script>
    <script type="text/javascript" src="./js/auth.js"></script>
</body>
</html>
